package com.cc.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

public class User implements Serializable {

    @Serial
    private static final long serialVersionUID = 5206383930534542680L;
    private Integer userId;
    private String userName;
    private String password;
    private String imageUrl;
    private String tel;
    private String sex;
    //@DateTimeFormat接收前端的日期格式(前台传给我的)
    @DateTimeFormat(pattern = "YYYY-MM-dd")
    //@JsonFormat后台返回给前台的格式(我传给前台的)  使用时，按需求加上时区 北京时间 东八区timezone = "GMT+8"
    @JsonFormat(pattern = "YYYY-MM-dd",timezone = "GMT+8")
    private Date registerDate;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", imageUrl='" + imageUrl + '\'' +
                ", tel='" + tel + '\'' +
                ", sex='" + sex + '\'' +
                ", registerDate=" + registerDate +
                '}';
    }
}
